{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Controler une créature Poppy"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Différentes créatures:\n",
    "* humanoid\n",
    "* torso\n",
    "* ergo\n",
    "* ..."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "WARNING:pypot.robot.config:Limits of 'head_y' changed to [-40, 8]\n"
     ]
    }
   ],
   "source": [
    "from pypot.creatures import PoppyHumanoid\n",
    "\n",
    "poppy = PoppyHumanoid()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "On peut donner des positions de base:\n",
    "* debout\n",
    "* assis"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "poppy.stand_position.start()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Les valeurs des moteurs hardware sont automatiquement synchronisées (à 50Hz) avec les valeurs de l'objet (R/W)."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "On peut récupérer la liste des moteurs, lire les différents registres des servo-moteurs:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<DxlMotor name=abs_y id=31 pos=-1.98>,\n",
       " <DxlMotor name=abs_x id=32 pos=-0.22>,\n",
       " <DxlMotor name=abs_z id=33 pos=-0.31>,\n",
       " <DxlMotor name=bust_y id=34 pos=-0.57>,\n",
       " <DxlMotor name=bust_x id=35 pos=-0.13>,\n",
       " <DxlMotor name=head_z id=36 pos=-0.44>,\n",
       " <DxlMotor name=head_y id=37 pos=0.67>,\n",
       " <DxlMotor name=l_shoulder_y id=41 pos=9.21>,\n",
       " <DxlMotor name=l_shoulder_x id=42 pos=19.71>,\n",
       " <DxlMotor name=l_arm_z id=43 pos=0.04>,\n",
       " <DxlMotor name=l_elbow_y id=44 pos=-20.26>,\n",
       " <DxlMotor name=r_shoulder_y id=51 pos=10.18>,\n",
       " <DxlMotor name=r_shoulder_x id=52 pos=-20.33>,\n",
       " <DxlMotor name=r_arm_z id=53 pos=0.48>,\n",
       " <DxlMotor name=r_elbow_y id=54 pos=-20.0>,\n",
       " <DxlMotor name=l_hip_x id=11 pos=2.59>,\n",
       " <DxlMotor name=l_hip_z id=12 pos=2.51>,\n",
       " <DxlMotor name=l_hip_y id=13 pos=-0.46>,\n",
       " <DxlMotor name=l_knee_y id=14 pos=0.22>,\n",
       " <DxlMotor name=l_ankle_y id=15 pos=-6.46>,\n",
       " <DxlMotor name=r_hip_x id=21 pos=1.8>,\n",
       " <DxlMotor name=r_hip_z id=22 pos=-1.8>,\n",
       " <DxlMotor name=r_hip_y id=23 pos=1.01>,\n",
       " <DxlMotor name=r_knee_y id=24 pos=0.04>,\n",
       " <DxlMotor name=r_ankle_y id=25 pos=-7.69>]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "poppy.motors"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-0.44"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "poppy.head_z.present_position"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.0"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "poppy.head_z.present_load"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{u'abs_x': 0.13,\n",
       " u'abs_y': -1.98,\n",
       " u'abs_z': 0.04,\n",
       " u'bust_x': -0.04,\n",
       " u'bust_y': -0.57,\n",
       " u'head_y': 0.6700000000000017,\n",
       " u'head_z': 0.15,\n",
       " u'l_ankle_y': -6.99,\n",
       " u'l_arm_z': 0.04,\n",
       " u'l_elbow_y': -20.18,\n",
       " u'l_hip_x': 2.33,\n",
       " u'l_hip_y': -0.1100000000000001,\n",
       " u'l_hip_z': 2.42,\n",
       " u'l_knee_y': 0.66,\n",
       " u'l_shoulder_x': 19.89,\n",
       " u'l_shoulder_y': 9.739999999999995,\n",
       " u'r_ankle_y': -7.69,\n",
       " u'r_arm_z': 0.13,\n",
       " u'r_elbow_y': -20.0,\n",
       " u'r_hip_x': 1.71,\n",
       " u'r_hip_y': 0.57,\n",
       " u'r_hip_z': -1.8,\n",
       " u'r_knee_y': 0.84,\n",
       " u'r_shoulder_x': -20.33,\n",
       " u'r_shoulder_y': 10.090000000000003}"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "{m.name: m.present_position for m in poppy.motors}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "De la même manière on peut écrire dans ces registres:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "poppy.head_z.goal_position = 30"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "poppy.head_z.goal_position = -30"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "import time\n",
    "\n",
    "from numpy import sin\n",
    "\n",
    "amp = 30\n",
    "freq = 0.5\n",
    "\n",
    "t0 = time.time()\n",
    "\n",
    "while time.time() - t0 < 10:\n",
    "    t = time.time()\n",
    "    pos = amp * sin(2 * 3.14 * freq * t)\n",
    "    \n",
    "    poppy.head_z.goal_position = pos\n",
    "    \n",
    "    time.sleep(0.02)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Primitives"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "from pypot.primitive.utils import Sinus\n",
    "\n",
    "s1 = Sinus(poppy, 50., [poppy.head_z, poppy.head_y], amp=20, freq=0.5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "s1.start()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "s2 = Sinus(poppy, 50., [poppy.head_z, ], amp=5, freq=0.75)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "s2.start()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "pos = []\n",
    "\n",
    "t0 = time.time()\n",
    "while time.time() - t0 < 10:\n",
    "    pos.append(poppy.head_z.present_position)\n",
    "    time.sleep(0.1)\n",
    "    \n",
    "s1.stop()\n",
    "s2.stop()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Populating the interactive namespace from numpy and matplotlib\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0xa9f95470>]"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": [
       "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\n",
       "vmEYRoP4b0LdibOTbe+wAAAAAElFTkSuQmCC\n"
      ],
      "text/plain": [
       "<matplotlib.figure.Figure at 0xaa052d90>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%pylab inline\n",
    "\n",
    "plot(pos)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Pareil en V-REP"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "http://localhost:8888/notebooks/Desktop/TTFX-VREP.ipynb"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Utilisation de SNAP"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Via un serveur web et accès à travers une REST API."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "from pypot.creatures import PoppyHumanoid\n",
    "\n",
    "poppy = PoppyHumanoid(simulator='vrep')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "from pypot.server.snap import SnapRobotServer\n",
    "\n",
    "snap_server = SnapRobotServer(poppy, '0.0.0.0', 8080)\n",
    "snap_server.run()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "http://snap.berkeley.edu/snapsource/snap.html#open:http://poppy-humanoid.local:8080/snap-blocks.xml"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Apprentissage autonome: [Explauto](https://github.com/flowersteam/explauto)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "        <iframe\n",
       "            width=\"400\"\n",
       "            height=300\"\n",
       "            src=\"https://player.vimeo.com/video/95405850\"\n",
       "            frameborder=\"0\"\n",
       "            allowfullscreen\n",
       "        ></iframe>\n",
       "        "
      ],
      "text/plain": [
       "<IPython.lib.display.VimeoVideo at 0x108048a10>"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from IPython.display import VimeoVideo\n",
    "\n",
    "VimeoVideo(95405850)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
